// pages/service/base-data/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    facePath: ''
  },
  chooseFace: function(){
    var that = this;
    wx.chooseImage({
      count: 1,
      sizeType: ['original', 'compressed'],
      sourceType: ['album', 'camera'],
      success: function (res) {
        var tempFilePaths = res.tempFilePaths;
        // TODO 执行图片上传
        wx.saveFile({
          tempFilePath: tempFilePaths[0],
          success: function (res) {
            var savedFilePath = res.savedFilePath
            that.setData({
              facePath: savedFilePath
            });
            
          }
        })
      }
    });
  }
})